<!DOCTYPE html>
<meta charset="utf-8" />
<style type="text/css">
.table-header {
    background-color: #46A3FF;
    color: #fff;
    font-size: 14px;
    line-height: 38px;
    margin-bottom: 1px;
    padding-left: 12px;
}
#resultDiv div table tr td{
	padding:10px;
	width:150px;
}
</style>
<div class="rowt" >
	<div class="col-xs-12" style="height: 370px; overflow: hidden; overflow-y :auto; border-bottom: 1px solid gray; " >
		<div>
			<table id="sample-table-1" class="table table-striped table-bordered table-hover" >
				<thead >
					<tr>
						<th>提现账户</th>
						<th>收款银行户名</th>
						<th>收款银行账号</th>
						<th>收款开户银行</th>
						<th>开户行省份</th>
						<th>开户行城市</th>
						<th>金额</th>
						<th>公私标识</th>
						<th>备注</th>
					</tr>
				</thead>
				<tbody id="mybody1">
				</tbody>
			</table>
		</div>
		<ul class="pagination pull-right no-margin" id="paging_bar_1">
		</ul>
	</div>
	<div id="dataStr" style="color:blue; padding-left: 20px;"></div>
	
<div class="row" style="text-align:right;padding-right: 15px;">
	支付密码 : <input type="password" id="payPwd" name="payPwd" value=""/>
</div>
<div class="col-xs-12">
			<div style="margin: 20px;">
				<span id="auth_btn">
				
				<!-- <a class="btn btn-small btn-default"
					onclick="statusUpdate0();"> 启用
					<i class="icon-envelope"></i> 
				</a> -->
				<!-- <a class="btn btn-small btn-default"
					onclick="statusUpdate1();"> 
					<i class="icon-envelope"></i> 禁用
				</a> -->
				
				</span> <span id="paging_bar" style="float: right">
					<a class="btn btn-small btn-warning"
					id="isOK">
					<i class="icon-envelope"></i>确认提现
					</a>
				</span>
			</div>
</div>

<div id="loading" style="text-align:center; color:#999; display: none;">正在提交，请稍等...</div>
<div id="resultDiv" style="display: none; text-align:center; margin-right:50px; width:100%;">
<div>
	<table >
		<thead>
			<tr>
				<td colspan="4">提现订单结果</td>
			</tr>
			<Tr>
				<td>序号</td>
				<td>订单号</td>
				<td>订单时间</td>
				<td>结果</td>
				<td>备注</td>
			</Tr>
		</thead>
		<tbody id="mybody2">
			
		</tbody>
		<tfoot>
			<tr>
				<td colspan="4" style="text-align:left;">
					<div id="resultStr" style="margin-left:50px; color:red;"></div>
				</td>
			</tr>
		</tfoot>
	</table>
</div>
</div>
	<div class="form-actions align-right  form-button-box" style="margin-top: 10px">
			&nbsp; 
			<button class="btn" type="button" onclick="javascript:dialog.close(this);">
				 关闭
			</button>
		</div>
</div>
<script type="text/javascript">
	var pageSize=7;
	var bodycp1=0;
	$(document).ready(function() {
		$("#checkboxlbl1").change(function(){  
			var is_checked =$("#checkboxlbl1").is(":checked");
			$("input[name='mybody1paging_bar_1']").each(function(){
				this.checked=is_checked;
			}); 
		});
		getjson("mpomng/custAccountManage/queryList.do",1,"mybody1","paging_bar_1");
		
		$("#payPwd").val("");
	});


	function getjson(url,cp,body,bar){
		var dialog=$("#dlg-custAccountView").Dialog();
		var dataList = dialog.pageParam.dataList;
		var dataStr = dialog.pageParam.dataStr;
		$("#dataStr").html(dataStr);
		$.each(dataList,function(index,obj){
			var inputVal=index;
			var tr ='<tr>'+	
			'<td>'+(obj.casAccount ? obj.casAccount : '自动')+'</td>'+
			'<td>'+obj.accountName+'</td>'+
			'<td>'+obj.cardNo+'</td>'+
			'<td>'+obj.bankName+'</td>'+
			'<td>'+obj.bankProvince+'</td>'+
			'<td>'+obj.bankCity+'</td>'+
			'<td>'+obj.txamt+'</td>'+
			'<td>'+obj.accountType+'</td>'+
			'<td>'+obj.remarks+'</td>'+
			'</tr>';
			$("#"+body).append(tr);
		});
		bodycp1=cp;
		$("#isOK").click(function(){
			var payPwd = $("#payPwd").val();
			if(!payPwd){
				msg.alert("错误", "支付密码不能为空", 'error');
				return false;
			}
			var $okBtn = $(this);
			$okBtn.hide();
			$("#dataStr").hide();
			$("#loading").show();
			var dataListStr=JSON.stringify(dataList);
			
			$.ajax({
				type : "post",
				url : "mpomng/confirmationEmbodiment.do",
				data:{"dataListStr":dataListStr,"payPwd":payPwd},
				dataType : 'json',
				success : function(result) {
					if(result.rspcod==200){
						/* alert(result.rspcod);
						alert(result.rspmsg); */
						
						$.each(result.obj,function(index,map){
							var inputVal=index;
							var tr ='<tr>';
							tr+='<td>'+map.mapNo+'</td>';
							if(map.ordNo){
								tr+='<td>'+map.ordNo+'</td>';
							}else{
								tr+='<td>订单未提交</td>';
							}
							tr+='<td>'+map.resultDate+'</td>'+
							'<td>'+map.resultStr+'</td>';
							if(map.remarks){
								tr+='<td style="width:300px;">'+map.remarks+'</td>';
							}else{
								tr+='<td>--</td>';
							}
							tr+='</tr>';
							$("#mybody2").append(tr);
						});
						$("#resultStr").html("*:"+result.rspmsg);
						$("#resultDiv").css("display","block");
						$("#loading").hide();
						
					}else{
						alert(result.rspmsg);
						$okBtn.show();
						$("#dataStr").show();
						$("#loading").hide();
					}
				},
				error : function(XMLHttpRequest, textStatus) {
					msg.alert("错误", "错误代码：" + XMLHttpRequest.status + ",错误描述："+ textStatus, 'error');
				}
			});
		});
	}
	
</script>